home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / john / hc_showd.hqx / ShowDialog XCMD 1.4 / card_6107.txt < prev    next >
Encoding:
Text File  |  1989-08-30  |  4.5 KB  |  155 lines

  1. -- card: 6107 from stack: in.4
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2607
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on closeCard
  8.   put empty into cd fld "theResult"
  9. end closeCard
  10.  
  11.  
  12. -- part 1 (button)
  13. -- low flags: 00
  14. -- high flags: A003
  15. -- rect: left=65 top=192 right=215 bottom=181
  16. -- title width / last selected line: 0
  17. -- icon id / first selected line: 0 / 0
  18. -- text alignment: 1
  19. -- font id: 0
  20. -- text size: 12
  21. -- style flags: 0
  22. -- line height: 16
  23. -- part name: "Change" Dialog
  24. ----- HyperTalk script -----
  25. on mouseUp
  26.   ShowDialog 2,4740,"Find What:","Change To:","Find & Change Dialog","Your string goes here."
  27.   if the result is empty then
  28.     put "You clicked the ΓÇ£CancelΓÇ¥ button." into cd fld "theResult"
  29.   else
  30.     put the result into temp
  31.     if item 1 of temp is empty then
  32.       put "String 1 was:  empty" & return into cd fld "theResult"
  33.     else put "String 1 was:" && item 1 of temp & return into cd fld "theResult"
  34.     if item 2 of temp is empty then
  35.       put "String 2 was:  empty" after cd fld "theResult"
  36.     else put "String 2 was:" && item 2 of temp after cd fld "theResult"
  37.   end if
  38. end mouseUp
  39.  
  40.  
  41.  
  42. -- part 2 (button)
  43. -- low flags: 00
  44. -- high flags: A003
  45. -- rect: left=101 top=227 right=250 bottom=200
  46. -- title width / last selected line: 0
  47. -- icon id / first selected line: 0 / 0
  48. -- text alignment: 1
  49. -- font id: 0
  50. -- text size: 12
  51. -- style flags: 0
  52. -- line height: 16
  53. -- part name: "Ask" Dialog
  54. ----- HyperTalk script -----
  55. on mouseUp
  56.   ShowDialog 2,4741,"Type something in this box:","","","This is the something!"
  57.   if the result is empty then
  58.     put "You clicked the ΓÇ£CancelΓÇ¥ button." into cd fld "theResult"
  59.   else put the result into cd fld "theResult"
  60. end mouseUp
  61.  
  62.  
  63.  
  64. -- part 3 (field)
  65. -- low flags: 01
  66. -- high flags: 0000
  67. -- rect: left=0 top=261 right=313 bottom=512
  68. -- title width / last selected line: 0
  69. -- icon id / first selected line: 0 / 0
  70. -- text alignment: 1
  71. -- font id: 3
  72. -- text size: 12
  73. -- style flags: 0
  74. -- line height: 16
  75. -- part name: theResult
  76.  
  77.  
  78. -- part 4 (button)
  79. -- low flags: 00
  80. -- high flags: A003
  81. -- rect: left=216 top=226 right=249 bottom=383
  82. -- title width / last selected line: 0
  83. -- icon id / first selected line: 0 / 0
  84. -- text alignment: 1
  85. -- font id: 0
  86. -- text size: 12
  87. -- style flags: 0
  88. -- line height: 16
  89. -- part name: "Ask" Dialog/no prompt
  90. ----- HyperTalk script -----
  91. on mouseUp
  92.   ShowDialog 2,4741,"Type something in this box:","","",""
  93.   if the result is empty then
  94.     put "You clicked the ΓÇ£CancelΓÇ¥ button or left the field empty." into cd fld "theResult"
  95.   else put the result into cd fld "theResult"
  96. end mouseUp
  97.  
  98.  
  99.  
  100. -- part 5 (button)
  101. -- low flags: 00
  102. -- high flags: A003
  103. -- rect: left=192 top=192 right=215 bottom=416
  104. -- title width / last selected line: 0
  105. -- icon id / first selected line: 0 / 0
  106. -- text alignment: 1
  107. -- font id: 0
  108. -- text size: 12
  109. -- style flags: 0
  110. -- line height: 16
  111. -- part name: "Change" Dialog with Checkbox
  112. ----- HyperTalk script -----
  113. on mouseUp
  114.   put TRUE into checked --checkbox initially checked
  115.   ShowDialog 2,4744,"Find What:","Change To:","Find & Change Dialog", "Your string goes here.",checked
  116.   if the result is empty then
  117.     put "You clicked the ΓÇ£CancelΓÇ¥ button." into cd fld "theResult"
  118.   else
  119.     put the result into temp
  120.     if item 1 of temp = "TRUE" then
  121.       put "Checked" into checked
  122.     else put "Unchecked" into checked
  123.     put "The checkbox was:" && checked & return into cd fld "theResult"
  124.     if item 2 of temp is empty then
  125.       put "String 1 was:  empty" & return after cd fld "theResult"
  126.     else put "String 1 was:" && item 2 of temp & return after cd fld "theResult"
  127.     if item 3 of temp is empty then
  128.       put "String 2 was:  empty" after cd fld "theResult"
  129.     else put "String 2 was:" && item 3 of temp after cd fld "theResult"
  130.   end if
  131. end mouseUp
  132.  
  133.  
  134.  
  135. -- part contents for background part 2
  136. ----- text -----
  137. ShowDialog XCMD Type 2 Examples
  138.  
  139. -- part contents for background part 3
  140. ----- text -----
  141. ShowDialog XCMD Type 2 (continued...)
  142.  
  143.  
  144. -- part contents for background part 1
  145. ----- text -----
  146.  
  147.  
  148. If you have only one Editable Text field in your dialog then "the result" will contain the contents of that field.  If you have two Editable Text fields, "the result" will contain the contents of both fields separated by a comma (e.g., string one, string two).  If you have a checkbox in your dialog, the first item in the result will be TRUE or FALSE, reflecting the condition of the checkbox.
  149.  
  150. If the user clicks the Cancel button "the result" will be empty.
  151.  
  152.  
  153. -- part contents for background part 7
  154. ----- text -----
  155. 12